<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	Object isSusse = request.getAttribute("isSusse");
%>
<%
	//获取登录标记
	Object loggedFlag = request.getSession().getAttribute("loggedFlag");
%>
<c:if test="${loggedFlag == 1}">
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加博文</title>
    
    <link rel="stylesheet" href="/PersonalBlog/backManaSyst/css/articleAdd.css">
    <link rel="stylesheet" href="/PersonalBlog/backManaSyst/css/tip.css">
    
    <link rel="stylesheet" type="text/css" href="/PersonalBlog/backManaSyst/simditor/styles/simditor.css" >
    <script type="text/javascript" src="/PersonalBlog/backManaSyst/simditor/scripts/jquery.min.js"></script>
    <script type="text/javascript" src="/PersonalBlog/backManaSyst/simditor/scripts/module.js"></script>
    <script type="text/javascript" src="/PersonalBlog/backManaSyst/simditor/scripts/hotkeys.js"></script>
    <script type="text/javascript" src="/PersonalBlog/backManaSyst/simditor/scripts/uploader.js"></script>
    <script type="text/javascript" src="/PersonalBlog/backManaSyst/simditor/scripts/simditor.js"></script>
</head>
<body>
	<c:if test="${isSusse != null }">
		<div class="loginTip">
	        <div>
	            <i class="iconfont icontianjiachenggong"></i>
	            <span>文章添加成功</span>
	        </div>
	    </div>
	    
	  <script>
        var loginTip = document.querySelector(".loginTip");
        function method(){
            loginTip.style.display = "block";
        }

        function clearTime(){
            loginTip.style.display = "none";
        }

        var timeId = window.setTimeout("method()",500);　　//定时执行，还可以这么写var timeId = window.setTimeout(method,1000);

        var timeId = window.setTimeout("clearTime()",3000);
    </script>
	</c:if>

    <div class="editArti">
        <h1>添加博文</h1>
        <form action="/PersonalBlog/articleAdd" method="POST">
            <!-- 重写选文件按钮 -->
<!--             <div class="resetFile divSet"> -->
<!--                 <label for="fileUpload"><div><i class="iconfont iconshangchuanwenjian"></i>上传封面图</div></label> -->
<!--                 <input type="file" name="fileUpload" id="fileUpload"> -->
<!--             </div><br><br> -->
            <div class="divSet"><span>标题：</span><input type="text" name="title" placeholder="请输入标题"> </div>
            <div class="divSet"><span>文章内容</span><textarea name="content" id="editor"></textarea> </div>
            <div class="divSet"><span>文章描述</span><textarea name="discript" id="" cols="30" rows="10"></textarea></div>
            
            <div class="resetSubmit">
                <label for="submit"><div>发布</div></label>
                <input type="submit" value="发布" name="submit" id="submit"> 
            </div>
            
           <div class="resetRe">
                <label for="reset"><div>重置</div></label>
                <input type="reset" name="reset" id="reset">
           </div>
        </form>
    </div>

    <script type="text/javascript">
        ( function(){
            Simditor.locale = 'zh-CN';
            let ed = new Simditor({
                textarea: $('#editor')
            });
        })();
    </script>
    <script src="/PersonalBlog/backManaSyst/js/articleAdd.js"></script>
</body>
</html>
</c:if>
<%
	if(loggedFlag == null || (int)loggedFlag == 0 || (int)loggedFlag == 3){
		request.getSession().setAttribute("loggedFlag", 3);	//表示从该页面跳转到登录页面，需要提醒用户登录后再操作该页面
		response.sendRedirect("/PersonalBlog/backManaSyst/login.jsp");
	}
%>